package com.innoking.docsys.utils;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class UnixUtil {

    /**
     * 获取时间戳
     *
     * @return
     * @author sunq
     */
    public static final long getUnixtime(Date date) {
        long epoch=0;
        try {
            DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
            String t = df.format(date);
            epoch = df.parse(t).getTime() / 1000;

        } catch (ParseException e) {

        }
        return epoch;
    }
}